package org.xx.armory.swing.builders;

import java.util.ArrayList;
import java.util.List;

public class TabbedPaneModelBuilder
        extends ComponentModelBuilder<TabbedPaneModel> {
    private final List<TabModel> tabs;

    public TabbedPaneModelBuilder() {
        this.tabs = new ArrayList<>();
    }

    public final TabbedPaneModelBuilder addTab(
            TabModel tab
    ) {
        this.tabs.add(tab);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TabbedPaneModel build() {
        return new TabbedPaneModel(getLineInfo(), getName(), isVisible(), this.tabs);
    }
}
